package com.ruoyi.service.impl;

import java.util.List;

import com.ruoyi.domain.T06;
import com.ruoyi.domain.TodaySum;
import com.ruoyi.mapper.T06Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.T07Mapper;
import com.ruoyi.domain.T07;
import com.ruoyi.service.IT07Service;

/**
 * 个人历史记录Service业务层处理
 *
 * @author ruoyi
 * @date 2024-07-30
 */
@Service
public class T07ServiceImpl implements IT07Service
{
    @Autowired
    private T07Mapper t07Mapper;
    @Autowired
    private T06Mapper T06Mapper;

    /**
     * 查询个人历史记录
     *
     * @param F0701 个人历史记录主键
     * @return 个人历史记录
     */
    @Override
    public T07 selectT07ByF0701(Long F0701)
    {
        return t07Mapper.selectT07ByF0701(F0701);
    }

    /**
     * 查询个人历史记录列表
     *
     * @param t07 个人历史记录
     * @return 个人历史记录
     */
    @Override
    public List<T07> selectT07List(T07 t07)
    {
        return t07Mapper.selectT07List(t07);
    }

    /**
     * 新增个人历史记录
     *
     * @param t07 个人历史记录
     * @return 结果
     */
    @Override
    public int insertT07(T07 t07)
    {
        return t07Mapper.insertT07(t07);
    }

    /**
     * 修改个人历史记录
     *
     * @param t07 个人历史记录
     * @return 结果
     */
    @Override
    public int updateT07(T07 t07)
    {
        return t07Mapper.updateT07(t07);
    }

    /**
     * 批量删除个人历史记录
     *
     * @param F0701s 需要删除的个人历史记录主键
     * @return 结果
     */
    @Override
    public int deleteT07ByF0701s(Long[] F0701s)
    {
        return t07Mapper.deleteT07ByF0701s(F0701s);
    }

    /**
     * 删除个人历史记录信息
     *
     * @param F0701 个人历史记录主键
     * @return 结果
     */
    @Override
    public int deleteT07ByF0701(Long F0701)
    {
        return t07Mapper.deleteT07ByF0701(F0701);
    }

    @Override
    public TodaySum counttoken(Long userId) {
        T06 t06 = T06Mapper.getT06ByF0601(userId);
        TodaySum todaySum = t07Mapper.counttoken(userId);
        Long count= t07Mapper.counts(userId);
        //总token
        todaySum.setCounttoken(count);
        return todaySum;
    }

    @Override
    public List<T07> selectlist(Long userId) {
        return t07Mapper.selectlist(userId);
    }
}
